package com.itheima.Controller;

import com.itheima.pojo.Account;
import com.itheima.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
    @Controller
    @RequestMapping("/account")
    public class AccountController {

    @Autowired
    private AccountService accountService;

    @RequestMapping("/save")
    @ResponseBody
    //保存的方法
    public String save(Account account){
    accountService.save(account);

        return "保存成功";
    }
    @RequestMapping("/findAll")
    //查询全部方法
    public ModelAndView findAll(){

        return null;
    }
}
